//// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
//
//package com.linqingying.gitcode.pullrequest.action
//
//import com.intellij.icons.AllIcons
//import com.intellij.ide.actions.RefreshAction
//import com.intellij.openapi.actionSystem.AnActionEvent
//import com.linqingying.gitcode.i18n.GitCodeBundle
//import com.linqingying.gitcode.pullrequest.ui.details.model.GCPRDetailsLoadingViewModel
//import java.util.function.Supplier
//
//class GCPRReloadDetailsAction
//  : RefreshAction(GitCodeBundle.messagePointer("pull.request.refresh.details.action"),
//                  Supplier { null },
//                  AllIcons.Actions.Refresh) {
//
//  override fun update(e: AnActionEvent) {
//    val vm = e.getData(GCPRDetailsLoadingViewModel.DATA_KEY)
//    e.presentation.isEnabledAndVisible = vm != null
//  }
//
//  override fun actionPerformed(e: AnActionEvent) {
//    val vm = e.getData(GCPRDetailsLoadingViewModel.DATA_KEY) ?: return
//    vm.requestReload()
//  }
//}
